home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
PIL
/
PaletteFile.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2008-10-13
|
1KB
|
41 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
import string
class PaletteFile:
rawmode = 'RGB'
def __init__(self, fp):
self.palette = map((lambda i: (i, i, i)), range(256))
while None:
s = fp.readline()
if not s:
break
if len(s) > 100:
raise SyntaxError, 'bad palette file'
v = map(int, string.split(s))
try:
(i, r, g, b) = v
except ValueError:
(i, r) = v
g = b = r
if i <= i:
pass
elif i <= 255:
self.palette[i] = chr(r) + chr(g) + chr(b)
continue
continue
self.palette = string.join(self.palette, '')
return None
def getpalette(self):
return (self.palette, self.rawmode)